package com.ruoyi.workFlow.service;

import com.github.pagehelper.Page;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.workFlow.domain.dto.DefinitionIdDTO;
import com.ruoyi.workFlow.domain.dto.ProcessDefinitionDTO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @ClassName IProcessDefinitionService
 * @Description 流程定义对象
 * @Author leizhang
 * Date 2021/10/21 2:46 下午
 * @Version 1.0
 **/
public interface IProcessDefinitionService {
    /**
     * @param multipartFile
     * @return java.lang.String
     * @Description : 流程定义上传
     * @Author : leizhang
     * @Date 2:53 下午 2021/10/21
     **/
    public String upload(MultipartFile multipartFile) throws IOException;

    /**
     * @param file
     * @return void
     * @Description : 上传并部署流程
     * @Author : leizhang
     * @Date 2:56 下午 2021/10/21
     **/
    public void uploadStreamAndDeployment(MultipartFile file) throws IOException;

    /**
     * @param id
     * @return int
     * @Description : 流程删除
     * @Author : leizhang
     * @Date 2:58 下午 2021/10/21
     **/
    public int deleteProcessDefinitionById(String id);

    /**
     * @param id
     * @param suspendState
     * @return void
     * @Description : 流程启动/挂载
     * @Author : leizhang
     * @Date 3:00 下午 2021/10/21
     **/
    public void suspendOrActiveApply(String id, Integer suspendState);

    /**
     * @param processDefinition
     * @param pageDomain
     * @return com.github.pagehelper.Page<com.ruoyi.activiti.domain.dto.ProcessDefinitionDTO>
     * @Description : 流程定义列表
     * @Author : leizhang
     * @Date 3:03 下午 2021/10/21
     **/
    public Page<ProcessDefinitionDTO> selectProcessDefinitionList(ProcessDefinitionDTO processDefinition, PageDomain pageDomain);

    /**
     * @param instanceId
     * @return com.ruoyi.activiti.domain.dto.DefinitionIdDTO
     * @Description : 流程信息获取by 实例id
     * @Author :
     * @Date 3:05 下午 2021/10/21
     **/
    public DefinitionIdDTO getDefinitionsByInstanceId(String instanceId);

    /**
     * @param stringBPMN
     * @return void
     * @Description : 通过stringBPMN添加流程定义
     * @Author : leizhang
     * @Date 8:47 下午 2021/10/28
     **/
    public void addDeploymentByString(String stringBPMN);

    /**
     * @param response
     * @param deploymentId
     * @param resourceName
     * @return void
     * @Description : 获取流程定义XML
     * @Author : leizhang
     * @Date 9:41 下午 2021/10/28
     **/
    public void getProcessDefineXML(HttpServletResponse response, String deploymentId, String resourceName) throws IOException;
}
